package edu.ecu.seng6270.goa.pss.unittests;

import static org.junit.Assert.*;

import org.junit.Test;

import edu.ecu.seng6270.goa.ropa.OrderItem;

public class TestOrderItem {

	@Test
	public void testValidateOrderItem() {
		OrderItem oi = new OrderItem();
		
		//TC-1 Validate Default OrderItem
		assertEquals(true, oi.validateOrderItem());

		//TC-2 Validate 5x7
		oi.setMySize(2);
		assertEquals(true, oi.validateOrderItem());

		//TC-3 Validate 8x10
		oi.setMySize(3);
		assertEquals(true, oi.validateOrderItem());
		
		//TC-4 INVALID SIZE
		oi.setMySize(-1);
		assertEquals(false, oi.validateOrderItem());

		//TC-5 INVALID SIZE
		oi.setMySize(0);
		assertEquals(false, oi.validateOrderItem());

		//TC-6 INVALID SIZE
		oi.setMySize(4);
		assertEquals(false, oi.validateOrderItem());
		
		//TC-7 Validate Matte Finish
		oi.setMySize(1);
		oi.setMyFinish(2);
		assertEquals(true, oi.validateOrderItem());

		//TC-8 INVALID FINISH
		oi.setMyFinish(0);
		assertEquals(false, oi.validateOrderItem());

		//TC-9 INVALID FINISH
		oi.setMyFinish(3);
		assertEquals(false, oi.validateOrderItem());

		//TC-10 Validate 1-Hour Time
		oi.setMySize(1);
		oi.setMyFinish(1);
		oi.setMyPTime(2);
		assertEquals(true, oi.validateOrderItem());

		//TC-11 INVALID TIME
		oi.setMyPTime(0);
		assertEquals(false, oi.validateOrderItem());

		//TC-12 INVALID TIME
		oi.setMyPTime(3);
		assertEquals(false, oi.validateOrderItem());

		/**
		 * Test Quantity Values
		 */
		oi = new OrderItem();
		
		//TC-13 INVALID BOUNDARY 0
		oi.setMyQuantity(0);
		assertEquals(false, oi.validateOrderItem());
		
		//TC-14 BOUNDARY 1
		oi.setMyQuantity(1);
		assertEquals(true, oi.validateOrderItem());
		
		//TC-15 BOUNDARY 2
		oi.setMyQuantity(2);
		assertEquals(true, oi.validateOrderItem());

		//TC-16 Random Equivalence
		oi.setMyQuantity(45);
		assertEquals(true, oi.validateOrderItem());
		
		//TC-15 BOUNDARY 99
		oi.setMyQuantity(99);
		assertEquals(true, oi.validateOrderItem());

		//TC-15 BOUNDARY 100
		oi.setMyQuantity(100);
		assertEquals(true, oi.validateOrderItem());

		//TC-13 INVALID BOUNDARY 101
		oi.setMyQuantity(101);
		assertEquals(false, oi.validateOrderItem());
		
	}

}
